package com.yu.tool;

import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: LittleFisher
 * @Date: 2021/06/09/15:42
 * @Description:
 */
public class testt {
    public static void main(String[] args) {
       /* String shen = "dsazfds\r\ngggg";
        String s = shen.replace("\r\n","<br>");
        System.out.println(s);*/
        String savePath = "C:\\Users\\22531\\Desktop\\workpace\\ssmScoreSystem\\web\\news\\";
        String saveName = "yy.txt";
        String str = "ff";

        FileOutputStream fos = null;
        try {
            fos = new FileOutputStream(savePath+saveName, true);//聊天记录保存地址
        } catch (FileNotFoundException e) {

            e.printStackTrace();
        }

        OutputStreamWriter osw = null;
        BufferedWriter br = null;
        try {
            osw = new OutputStreamWriter(fos,"UTF-8");
            br = new BufferedWriter(osw);
            try {
                br.write(str);
                br.write("\n");
                br.flush();
            } catch (IOException e1) {

                e1.printStackTrace();
            }
        }catch (UnsupportedEncodingException e2) {

            e2.printStackTrace();
        }
    }
}
